import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AdmAssetReturnVO, AdmAssetReturnForm, AdmAssetReturnQuery } from '@/api/general/administration/asset/return/types';

/**
 * 查询资产归还列表
 * @param query
 * @returns {*}
 */

export const listAdmAssetReturn = (query?: AdmAssetReturnQuery): AxiosPromise<AdmAssetReturnVO[]> => {
  return request({
    url: '/system/admAssetReturn/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询资产归还详细
 * @param id
 */
export const getAdmAssetReturn = (id: string | number): AxiosPromise<AdmAssetReturnVO> => {
  return request({
    url: '/system/admAssetReturn/' + id,
    method: 'get'
  });
};

/**
 * 新增资产归还
 * @param data
 */
export const addAdmAssetReturn = (data: AdmAssetReturnForm) => {
  return request({
    url: '/system/admAssetReturn',
    method: 'post',
    data: data
  });
};

/**
 * 修改资产归还
 * @param data
 */
export const updateAdmAssetReturn = (data: AdmAssetReturnForm) => {
  return request({
    url: '/system/admAssetReturn',
    method: 'put',
    data: data
  });
};

/**
 * 删除资产归还
 * @param id
 */
export const delAdmAssetReturn = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/admAssetReturn/' + id,
    method: 'delete'
  });
};
